<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>单选选择器</title>
    <link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="${s.base}/css/base/base.css" media="all" /></head>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/dtree/dtree.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/dtree/font/iconfont.css"/>
</head>
<body>
<div class="page-content-wrap clearfix">
    <input type="hidden" id="resultId"/>
    <input type="hidden" id="resultName"/>
    <form class="layui-form">
        <div class="layui-tab pad0">
            <div class="layui-tab-content pad0">
                <div class="layui-tab-item"></div>
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item marb5">
                        <label class="layui-form-label w75">关键字：</label>
                        <div class="layui-input-inline marl90 margin0 clearfix">
                            <input type="text" name="searchInput" id="searchInput" placeholder="请输入关键字" autocomplete="off" class="layui-input">
                        </div>
                        <!--树开始-->
                        <div class="cont-dtree dtree-height" style=" padding-left:60px;">
                            <ul id="org" class="dtree" data-id="0" style=""></ul>
                        </div>
                        <!--树结束-->
                    </div>

                </div>
                <div class="layui-tab-item">

                </div>
            </div>
        </div>
        <div class="layui-form-item margin0" style="padding-left: 10px;">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" type="button" id="save">提交</button>
                <button type="button" id="cancel" class="layui-btn layui-btn-primary">取消</button>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript" src="${s.base}/js/layui/layui.js"></script>
<script type="text/javascript" src="${s.base}/js/base/base.js"></script>
<script>
    layui.use(['form', 'jquery', 'layer','dtreeUtil'], function() {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery,
            dtreeUtil = layui.dtreeUtil;
        var dtree=dtreeUtil.baseDtree("#org",'${url}');
        dtreeUtil.dTreeClick("org",function (param) {
            $("#resultId").val(param.nodeId);
            $("#resultName").val(param.context);
        });
    });
</script>
</body>

</html>